package com.zygh.lz.controller;

import com.zygh.lz.entity.duty.DutySchedule;
import com.zygh.lz.service.DutyScheduleService;
import com.zygh.lz.stapprove.SysPcLog;
import com.zygh.lz.vo.ResultBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author lee
 */
@RestController
@RequestMapping("duty/schedule")
@Api(tags = "勤务日程接口")
public class DutyScheduleController {
    @Resource
    private DutyScheduleService dutyScheduleService;

    @GetMapping("/find")
    @ApiOperation("分页查询")
    @ApiImplicitParams({@ApiImplicitParam(name = "pageSize",value = "分页页大小",dataType = "int")
                        ,@ApiImplicitParam(name = "pageNum",value = "分页页数",dataType = "int")})
    public ResultBean find(DutySchedule dutySchedule){
        return dutyScheduleService.find(dutySchedule);
    }

    @PostMapping("/add")
    @ApiOperation("新增")
    //@SysPcLog(module = "新增勤务日程",operation = "新增")
    public ResultBean add(@RequestBody DutySchedule dutySchedule){
        return dutyScheduleService.add(dutySchedule);
    }

    @PostMapping("/update")
    @ApiOperation("修改")
    //@SysPcLog(module = "修改勤务日程",operation = "修改")
    public ResultBean update(@RequestBody DutySchedule dutySchedule){
        return dutyScheduleService.update(dutySchedule);
    }

    @PostMapping("/delete")
    @ApiOperation("删除")
    //@SysPcLog(module = "删除勤务日程",operation = "删除")
    public ResultBean delete(@RequestBody DutySchedule dutySchedule){
        return dutyScheduleService.delete(dutySchedule);
    }

    @GetMapping("/find/mode")
    @ApiOperation("根据勤务模式查看详细信息")
    public ResultBean findMode(String mode){
        return dutyScheduleService.findMode(mode);
    }
}
